#introduction.py
# 创建对象
class1 = ['zhangsan','wangwu','wangwu','lisi']
print('class1 type is{}'.format(type(class1)))

# 获取对象数目
len1 = class1.__len__()
print('there are {} students in this class'.format(len1))
len2 = len(class1)     #语法蜜糖
print('there are {} students in this class'.format(len2))

# 获得对象
first1 = class1.__getitem__(0)
print('the first student is {}'.format(first))

first2 = class1[0]     #语法蜜糖
print('the first student is {}'.format(first2))

#反向编号
print('the second student is {}'.format(class1[1]))
print('the last student is {}'.format(class1[3]))
print('the last student is {}'.format(class1[-1]))
print('the last one student is {}'.format(class1[-2]))


#不同类型的对象
student1 = [20200909,'zhangsan',True,100,80]
print('the num is {}'.format(student1[0]))
print('the name is {}'.format(student1[1]))
print('the sex is {}'.format(student1[2]))
print('the score of math is {}'.format(student1[3]))